function maxDeep(root) {
    let max = 0;
    function dfs(node, deep) {
        if (!root.left && !root.right) max = Math.max(max, deep) // 最后才比较
        if (node.left) dfs(node.left, deep + 1)
        if (node.right) dfs(node.right, deep + 1)
    }
    dfs(root, max)
    return max
}